// pages/personal/components/header/login/index.js
Component({

  /**
   * 组件的属性列表
   */
  properties: {
    riliList: {
      type: Array,
      value: []
    },
    mode: {
      type: String,
      value: "schedule"
    },
    count: {
      type: Number,
      value: 0
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
  },

  /**
   * 组件的方法列表
   */
  methods: {
    handleClickTab(e) {
      this.triggerEvent("onMode", e.currentTarget.dataset.type);
    },

    handleClickSchedule() {
      if(this.data.mode === "schedule") {
        this.triggerEvent("onSchedule");
      } else {
        this.triggerEvent("onMode", "schedule");
      }
    },

    handleSelectCalendarDay(e) {
      const {
        time,
        index
      } = e.currentTarget.dataset;
      
      this.triggerEvent("onCalendarDay", {
        time,
        index
      })
    }
  }
})